/*
 * Node.java
 *
 * Created on 17 marzec 2007, 17:10
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package formykwadratowe;

import java.util.HashSet;

/**
 *
 * @author zurekm
 */
public class Node {
    private String name;
    private HashSet<String> up;
    private HashSet<String> down;
    /** Creates a new instance of Node */
    public Node(String name) {
        this.name = name;
        this.up = new HashSet<String>(0);
        this.down = new HashSet<String>(0);
    }
    public String getName() { return this.name; }
    
    public void addDown(String name) {
        this.down.add(name);
    }
    public void addUp(String name) {
        this.up.add(name);
    }
    public boolean isInUp(String name) {
        return this.up.contains(name);
    }
    public boolean isInDown(String name) {
        return this.down.contains(name);
    }
    
    public boolean isMaxElement() {
        return this.up.isEmpty();
    }
    
    public boolean isMinElement() {
        return this.down.isEmpty();
    }

    public HashSet<String> getDown() {
        return this.down;
    }

    public HashSet<String> getUp() {
        return this.up;
    }


}
/*
 1 | 3
2 | 4
3 | 5
4 | 5,6
5 | *,+
6 | +,A
7 | 6,8
8 | A
 */